package com.dragon.modules.yuegou.query.coupon;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.coupon.CouponPackageTemplateStockEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 券包模板库存 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-02-28 18:30:17
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class CouponPackageTemplateStockQuery extends CouponPackageTemplateStockEntity implements Query<CouponPackageTemplateStockEntity> {

    /** 券包模板ID查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 总量查询条件 */
	@JsonUnwrapped(prefix = "total")
	private Condition<Integer> totalCondition;

    /** 出售量查询条件 */
	@JsonUnwrapped(prefix = "sale")
	private Condition<Integer> saleCondition;

    /** 库存查询条件 */
	@JsonUnwrapped(prefix = "stock")
	private Condition<Integer> stockCondition;

    /** 版本查询条件 */
	@JsonUnwrapped(prefix = "version")
	private Condition<Integer> versionCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 最后更新时间查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public CouponPackageTemplateStockQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public CouponPackageTemplateStockQuery(CouponPackageTemplateStockEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public CouponPackageTemplateStockQuery(CouponPackageTemplateStockQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.totalCondition != null) {
			this.totalCondition = other.totalCondition.copy();
		}
		if(other.saleCondition != null) {
			this.saleCondition = other.saleCondition.copy();
		}
		if(other.stockCondition != null) {
			this.stockCondition = other.stockCondition.copy();
		}
		if(other.versionCondition != null) {
			this.versionCondition = other.versionCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<CouponPackageTemplateStockEntity> toQueryWrapper() {
		QueryWrapper<CouponPackageTemplateStockEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (totalCondition != null) {
			totalCondition.toWrapper(wrapper, COL_TOTAL);
		}
		if (saleCondition != null) {
			saleCondition.toWrapper(wrapper, COL_SALE);
		}
		if (stockCondition != null) {
			stockCondition.toWrapper(wrapper, COL_STOCK);
		}
		if (versionCondition != null) {
			versionCondition.toWrapper(wrapper, COL_VERSION);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回券包模板ID查询条件
	 * 
	 * @return idCondition 券包模板ID查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取券包模板ID查询条件
	 * 
	 * @return idCondition 券包模板ID查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置券包模板ID查询条件
	 * 
	 * @param idCondition 券包模板ID查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回总量查询条件
	 * 
	 * @return totalCondition 总量查询条件
	 */
	public Condition<Integer> total() {
		this.totalCondition = new Condition<>();
		return this.totalCondition;
	}
	
	/**
	 * 获取总量查询条件
	 * 
	 * @return totalCondition 总量查询条件
	 */
	public Condition<Integer> getTotalCondition() {
		return totalCondition;
	}

	/**
	 * 设置总量查询条件
	 * 
	 * @param totalCondition 总量查询条件
	 */
	public void setTotalCondition(Condition<Integer> totalCondition) {
		this.totalCondition = totalCondition;
	}

	/**
	 * 构造并返回出售量查询条件
	 * 
	 * @return saleCondition 出售量查询条件
	 */
	public Condition<Integer> sale() {
		this.saleCondition = new Condition<>();
		return this.saleCondition;
	}
	
	/**
	 * 获取出售量查询条件
	 * 
	 * @return saleCondition 出售量查询条件
	 */
	public Condition<Integer> getSaleCondition() {
		return saleCondition;
	}

	/**
	 * 设置出售量查询条件
	 * 
	 * @param saleCondition 出售量查询条件
	 */
	public void setSaleCondition(Condition<Integer> saleCondition) {
		this.saleCondition = saleCondition;
	}

	/**
	 * 构造并返回库存查询条件
	 * 
	 * @return stockCondition 库存查询条件
	 */
	public Condition<Integer> stock() {
		this.stockCondition = new Condition<>();
		return this.stockCondition;
	}
	
	/**
	 * 获取库存查询条件
	 * 
	 * @return stockCondition 库存查询条件
	 */
	public Condition<Integer> getStockCondition() {
		return stockCondition;
	}

	/**
	 * 设置库存查询条件
	 * 
	 * @param stockCondition 库存查询条件
	 */
	public void setStockCondition(Condition<Integer> stockCondition) {
		this.stockCondition = stockCondition;
	}

	/**
	 * 构造并返回版本查询条件
	 * 
	 * @return versionCondition 版本查询条件
	 */
	public Condition<Integer> version() {
		this.versionCondition = new Condition<>();
		return this.versionCondition;
	}
	
	/**
	 * 获取版本查询条件
	 * 
	 * @return versionCondition 版本查询条件
	 */
	public Condition<Integer> getVersionCondition() {
		return versionCondition;
	}

	/**
	 * 设置版本查询条件
	 * 
	 * @param versionCondition 版本查询条件
	 */
	public void setVersionCondition(Condition<Integer> versionCondition) {
		this.versionCondition = versionCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回最后更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 最后更新时间查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取最后更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 最后更新时间查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置最后更新时间查询条件
	 * 
	 * @param modifiedTimeCondition 最后更新时间查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

}
